package niuke;

/**
 * description:
 * author:张腾
 * date:2021-07-07
 */

/**
 * 操作给定的二叉树，将其变换为源二叉树的镜像
 */
public class NC72 {
    public TreeNode Mirror (TreeNode pRoot) {
        // write code here
        return change(pRoot);
    }
    public TreeNode change(TreeNode root){
        if (root==null) return null;
        TreeNode right = change(root.left);
        TreeNode left = change(root.right);
        root.left = left;
        root.right = right;
        return root;
    }
}
